package org.colcon.web.model;

import java.util.HashMap;
import java.util.Map;

import org.colcon.web.model.framework.ILaw;

public class Law extends ParamItem implements ILaw
{
	private static final long serialVersionUID = 6349753343373820332L;

	public static final String
	
		// arguments
		GROUP = "group",
		TEXT = "text";
	
	private String text;
	
	public Law()
	{
		this(new HashMap<String, String>());
	}
	
	public Law(Map<String, String> args)
	{
		this(args.get(PARENT), args.get(ID), args.get(TEXT));
	}
	
	public Law(String parent, String id, String text)
	{
		super(parent, id);
		
		this.text = text;
	}
	
	public String getGroup()
	{
		return Model.parseGroup(getParentPath());
	}
	
	public String getText()
	{
		return text;
	}
	
	public void setText(String text)
	{
		this.text = text;
	}
}